﻿#include <QCoreApplication>

#include <QDebug>

#include "concreteprototype.h"
#include "workmodel.h"

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    ConcretePrototype* proto1 = new ConcretePrototype(1, "proto1", "model1");
    qDebug() << "before copy";
    proto1->show();

    qDebug() << "light copy";
    ConcretePrototype* proto2 = proto1;
    proto2->setID(2);
    proto2->setName("proto2");
    proto2->setModelName("model2");
    proto1->show();
    proto2->show();

    qDebug() << "deep copy";
    ConcretePrototype* proto3 = proto1->clone();
    proto2->setID(3);
    proto2->setName("proto3");
    proto2->setModelName("model3");
    proto1->show();
    proto3->show();

    return a.exec();
}
